//
//  carViewController.m
//  car
//
//  Created by chenxu on 4/10/15.
//  Copyright (c) 2015 chenxu. All rights reserved.
//

#import "com_carViewController.h"
#import "carinfo_cell.h"
#import "NetAPIManager.h"
#define kCellIdentifier_carinfo @"carinfo_cell"
@interface com_carViewController ()

@end

@implementation com_carViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [_myTableview registerClass:[carinfo_cell class] forCellReuseIdentifier:kCellIdentifier_carinfo];
  
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - table view
#pragma mark Table Data Source Methods
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 7;
}
#pragma mark Table Delegate Methods
- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    carinfo_cell* cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier_carinfo forIndexPath:indexPath];
    NSString *title = @"";
    NSString *value = @"";
    NSInteger row = indexPath.row;
    if (row == 0){
        title = @"车牌号";
        value = _myOrder.Carid;
    }
    if (row == 1) {
        title = @"车品牌";
        value = _myOrder.Carpinpai;
    }
    if (row == 2){
        title = @"保险到期";
        value = _myOrder.Carbaoxiandaoqi;
    }
    if (row == 3){
        title = @"购车日期";
        value = _myOrder.Carbuydate;
    }
    if (row == 4){
        title = @"发动机号";
        value = _myOrder.Carfadongjiid;
    }
    if (row == 5){
        title = @"车价格";
        value = _myOrder.Carprice;
    }
    if (row == 6){
        title = @"车型号";
        value = _myOrder.Carxinghao;
    }
    [cell setLeft:title right:value];
    return cell;
    
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
}


@end
